package com.packenius.library.xspdf;

import java.util.HashMap;
import java.util.Map;

/**
 * Alternative font encoding.
 * 
 * @author Christian Packenius, 2013.
 */
class XST1AltFontEncoding3 extends XSAlternativeFontEncoding {
  /**
   * Maps an Utf-8 (Unicode?) code (0..65535) to the byte in this font encoding.
   */
  static final Map<Character, Character> altFontEncoding3 = new HashMap<Character, Character>();

  private static final String altFontEnc3Diffs = "127 /Lcommaaccent /Atilde /Aogonek /Aring /Otilde /zdotaccent /Ecaron "
      + "/Iogonek /kcommaaccent /minus /Icircumflex /ncaron "
      + "/tcommaaccent /logicalnot /odieresis /udieresis /notequal /gcommaaccent "
      + "/eth /zcaron /ncommaaccent /onesuperior /imacron /Euro";

  static {
    altFontEncoding3.put('\u013b', (char) 127);
    altFontEncoding3.put('\u00c3', (char) 128);
    altFontEncoding3.put('\u0104', (char) 129);
    altFontEncoding3.put('\u00c5', (char) 130);
    altFontEncoding3.put('\u00d5', (char) 131);
    altFontEncoding3.put('\u017c', (char) 132);
    altFontEncoding3.put('\u011a', (char) 133);
    altFontEncoding3.put('\u012e', (char) 134);
    altFontEncoding3.put('\u0137', (char) 135);
    altFontEncoding3.put('\u2212', (char) 136);
    altFontEncoding3.put('\u00ce', (char) 137);
    altFontEncoding3.put('\u0148', (char) 138);
    altFontEncoding3.put('\u0163', (char) 139);
    altFontEncoding3.put('\u00ac', (char) 140);
    altFontEncoding3.put('\u00f6', (char) 141);
    altFontEncoding3.put('\u00fc', (char) 142);
    altFontEncoding3.put('\u2260', (char) 143);
    altFontEncoding3.put('\u0123', (char) 144);
    altFontEncoding3.put('\u00f0', (char) 145);
    altFontEncoding3.put('\u017e', (char) 146);
    altFontEncoding3.put('\u0146', (char) 147);
    altFontEncoding3.put('\u00b9', (char) 148);
    altFontEncoding3.put('\u012b', (char) 149);
    altFontEncoding3.put('\u20ac', (char) 150);
  }

  /**
   * @see com.packenius.library.xspdf.XSAlternativeFontEncoding#getPdfDifferencesListContent()
   */
  @Override
  public String getPdfDifferencesListContent() {
    return altFontEnc3Diffs;
  }

  /**
   * @see com.packenius.library.xspdf.XSAlternativeFontEncoding#getID()
   */
  @Override
  public String getID() {
    return "3";
  }

  /**
   * @see com.packenius.library.xspdf.XSAlternativeFontEncoding#getCharacterEncodingMap()
   */
  @Override
  public Map<Character, Character> getCharacterEncodingMap() {
    return altFontEncoding3;
  }
}
